﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace Vecka1.Controller
{
    class MasterController
    {
        Model.Model m_model;
        View.GameView m_view;

        public MasterController(GraphicsDeviceManager a_manager, ContentManager a_contentManager)
        {
            m_model = new Model.Model();
            m_view = new View.GameView(a_manager, a_contentManager);
        }

        internal void Update(float a_elapsedTime)
        {
            m_model.Update(a_elapsedTime);
        }

        internal void Draw(float a_elapsedTime, Microsoft.Xna.Framework.Graphics.GraphicsDevice GraphicsDevice)
        {
            //get the player position for the view
            Vector2 modelPlayerPosition = m_model.GetItemPosition();

            //Draw the background and player
            m_view.DrawLevel(GraphicsDevice, modelPlayerPosition);
        }
    }
}
